/*
 * 资源定义
 */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Dolls
{
    /// <summary>
    /// 资源类型
    /// </summary>
    public enum eResType
    {
        Null = 0, 
        METAL947,   //超金属947
        SUPERCRYSTAL, //超级水晶
        TIMECAPSULE,  //时空胶囊
    }

    /// <summary>
    /// 资源记录
    /// </summary
    public class cResInst 
    {
        public static double metal947 = 10000;     //947金属
        public static double superCrystal = 10000; //超晶体
        public static double timeCapsule = 10;  //时间胶囊

        public static void Save()
        {
            PlayerPrefs.SetString("metal947", metal947.ToString());
            PlayerPrefs.SetString("superCrystal", superCrystal.ToString());
            PlayerPrefs.SetString("timeCapsule", timeCapsule.ToString());
            PlayerPrefs.Save();
        }

        public static void Load()
        {
            string str = PlayerPrefs.GetString("metal947", "10000");
            metal947 = double.Parse(str);
            str = PlayerPrefs.GetString("superCrystal", "10000");
            superCrystal = double.Parse(str);
            str = PlayerPrefs.GetString("timeCapsule", "10");
            timeCapsule = double.Parse(str);
        }
    }

}


